import { _decorator, Component, director, Label, Node, Sprite } from 'cc';
import { emits } from '../data/enums';
import { gameConfig } from '../data/gameConfig';
import { loadRes } from '../utils/loadRes';
const { ccclass, property } = _decorator;

@ccclass('playerTx')
export class playerTx extends Component {
    @property(Sprite)
    txSprite: Sprite;
    onEnable() {
        director.on(emits.playerTx, this.updateTx, this);
    }

    updateTx() {
        let num = gameConfig.currTxNum;
        this.txSprite.spriteFrame = loadRes.ins.getSpriteFrame("animal" + num);
    }
}


